function fun(z,x,c){
    switch(x){
        case "+":return z+c;break;
        case "-":return z-c;break;
        case "*":return z*c;break;
        case "/":return z/c;break;
    }
}
console.log(fun(3,"+",3))